//
//  Http.h
//  CherryPlumStore
//
//  Created by SDX on 2019/9/21.
//  Copyright © 2019 千凯. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void (^SuccessBlock)(id result);
typedef void(^FailBlock)(NSString *errResult);

@interface Http : NSObject

/**
 get请求
 
 @param url 网址
 @param params 参数
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
+(void) getWithUrl:(NSString *)url
        WithParams: (NSDictionary *)params
        WithSuccessBlock:(SuccessBlock)successBlock
        WithFailBlock:(FailBlock)failBlock;


/**
 post请求

 @param url 网址
 @param params 参数
 @param successBlock 成功回调
 @param failBlock 失败回调
 */
+(void) postWithUrl: (NSString *)url
        WithParams: (NSDictionary *)params
        WithSuccessBlock:(SuccessBlock)successBlock
        WithFailBlock:(FailBlock)failBlock;

@end
